package com.res.entity;

import javax.annotation.Generated;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name="student")
public class Student {
@Id
private Integer stuid;//学号
private String sname;//学生姓名
private String sex;//学生性别
private Integer age;//年龄
@ManyToOne(fetch=FetchType.EAGER)
@JoinColumn(name="sid")
private Subjects sub;
public Integer getStuid() {
	return stuid;
}
public void setStuid(Integer stuid) {
	this.stuid = stuid;
}
public String getSname() {
	return sname;
}
public void setSname(String sname) {
	this.sname = sname;
}
public String getSex() {
	return sex;
}
public void setSex(String sex) {
	this.sex = sex;
}
public Integer getAge() {
	return age;
}
public void setAge(Integer age) {
	this.age = age;
}
public Subjects getSub() {
	return sub;
}
public void setSub(Subjects sub) {
	this.sub = sub;
}
@Override
public String toString() {
	return "Student [stuid=" + stuid + ", sname=" + sname + ", sex=" + sex + ", age=" + age + ", sub=" + sub + "]";
}
public Student(Integer stuid, String sname, String sex, Integer age, Subjects sub) {
	super();
	this.stuid = stuid;
	this.sname = sname;
	this.sex = sex;
	this.age = age;
	this.sub = sub;
}
public Student() {
	super();
	// TODO Auto-generated constructor stub
}

}
